Replication package for "The Effects of Foreign Multinationals on Workers and Firms in the United States," by Setzler and Tintelnot (2021).
----------------------------

This is an overview of the steps required to replicate the empirical analyses of Setzler and Tintelnot (2021). Additional details are provided in the README files contained in the subdirectories of this replication package.

*1. Prepare the external data files:* These are the external (publicly available) data files utilized in the analyses. Within this replication package, copies of the raw data files are available in the external/raw_data/ folder, copies of the cleaned data files utilized in the analyses are available in the external/clean_data/ folder, and the execution scripts utilized to transform the raw data files into the clean data files are available in the external/codes/ folder. See external/README.txt for detailed instructions.

*2. Prepare the internal data files:* These are the internal (restricted access) data files utilized in the analyses. To gain access to the restricted access data files, apply to the Internal Revenue Service (IRS) Statistics of Income (SOI) Joint Statistical Research Program (JSRP). The call for proposals and directions to apply to the JSRP are available from https://www.irs.gov/statistics/soi-tax-stats-joint-statistical-research-program. Once access is obtained, request from the SOI archivist the (restricted access) R package called manageCDW_1.0.tar.gz and the associated instructions from the README.txt file. Following the instructions, this package will automatically produce the cleaned internal data files (in the data formats and directory structure required by the empirical analyses).

*3. Execute the empirical analyses using the internal and external data files:* The analyses are executed using the replication scripts provided in the server/ folder within this replication package. These replication scripts require the R package server/FDI_1.0.tar.gz. The raw code from which FDI_1.0.tar.gz is built is included in the FDI/ folder within this replication package. Prior to executing the scripts in the server/ folder, the external data files (step 1 above) must be transferred to the SOI analysis server and placed in the folder specified by the replication scripts (which is a directory variable that can be chosen by the user), and the internal data files (step 2 above) must be created following the (restricted access) instructions. The contents of the server/ folder must also be copied to the SOI analysis server, and the three provided *.tar.gz R packages must be install locally on the server. Once all files are in place on the analysis server, execute the commands in server/README.txt, collect the resulting CSV files, submit them to SOI administration for disclosure review, and then copy them to the results/raw_moments/ folder within this replication package.

*4. Produce tables and figures:* Copies of all disclosure-approved output from the empirical analyses using the internal and external data files (produced by step 3 above) are available as CSV files in this replication package in the results/raw_moments/ folder. Given these CSV files, source the script in the folder results/results.R, which will replicate all tables and figures by Setzler and Tintelnot (2021) into the results/tables_and_figures/ folder. Also source the Stata do-file called results_maps.do, which reproduces the maps shown in the paper. Copies of all tables and figures are included in this replication package in the results/tables_and_figures/ folder.
